<template>
  <view class="noData">
    <view class="noDataImgBox flac">
      <image class="nodataImg" src="/static/images/global/nodata.png" mode="scaleToFill" />
    </view>
    <view class="noRecord fs32">暂无数据</view>
    <view class="wp100 flch mt100" v-if="showBtn">
      <view class="w400 mt40">
        <u-button type="primary" @click="btnClick" shape="circle" color="#27C1A5" :throttleTime="2000">{{ btnTitle }}</u-button>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    showBtn: {
      type: Boolean,
      default: false
    },
    btnTitle: {
      type: String,
      default: '新增'
    }
  },
  methods: {
    btnClick() {
      this.$emit('btnClick');
    }
  }
};
</script>
<style lang="scss" scoped>
.noData {
  padding: 10rpx 32rpx 24rpx 32rpx;
  height: 100%;
  box-sizing: border-box;
  overflow-y: scroll;
  .noDataImgBox {
    width: 100%;
    height: 300rpx;
    margin-top: 250rpx;
  }
  .nodataImg {
    width: 340rpx;
    height: 340rpx;
  }
  .noRecord {
    width: 100%;
    text-align: center;
    color: #ccc;
  }
}
</style>
